Implemented Simple and Detailed Contact Views in SwiftUI - #477
Open
kutakmir wants to merge 14 commits into
Open
Conversation
Merge with apple
SwiftUI - Simple and Detail Contact Views
erik-apple
requested changes
Jul 14, 2020
erik-apple
left a comment
Contributor
There was a problem hiding this comment.
Looks like a good start!
I left number of comments in-line.
There is still a bit of work to do connecting the contact controller to the contact view model, but we're happy to provide guidance on that if you get stuck!
Author
|
@erik-apple thanks for the feedback and explanation on some of the things - I'll follow up shortly! |
…esTech/CareKit into feature/swiftUIcontact
Feature/swift u icontact
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
This PR introduces simple and detail contact views in the SwiftUI part of CareKit and CareKitUI.
Interesting points
In the Detailed Contact View, I couldn't use
.subheadlineFont style because it only allows a single line of text. That's probably a bug in SwiftUI. The same code is being used in the InstructionsTaskView alongside with.lineLimit(nil)which doesn't have any effect to the line limit.The HeaderView didn't contain any image up until now. So included the image. We still don't have a way to populate images for contacts in CareKit so all images are just system placeholders for now.
The size of the image and scale of the fonts doesn't correspond 1:1 to the UIKit version. This is because we are using the predefined sizes. If we wanted to use different sizes for these use-cases, we would have to define them in constants.
Looking forward to your feedback!